#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QGridLayout>
#include <QPropertyAnimation>
#include <QGraphicsOpacityEffect>
#include <QTimer>
#include <QTime>
#include <QParallelAnimationGroup>
#include <QSequentialAnimationGroup>
#include <QDebug>
#include "user_interact_window.h"
#include <QMouseEvent>


#ifdef  __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <pthread.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <arpa/inet.h>
#include <stdbool.h>
#include <mysql/mysql.h>
#include <stdint.h>
#include <sqlite3.h>

int sqlite3_open(const char *filename, sqlite3 **ppDb);

#ifdef  __cplusplus
}
#endif

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:

    void on_Login_Button_clicked();

    void on_password_visible_pushButton_clicked();

    void on_Quit_pushButton_clicked();

    void on_MInimize_pushButton_clicked();

    void on_Register_Button_clicked();

    void on_backToNameMaking_pushButton_clicked();

    void on_register_password_visible_pushButton_clicked();

    void on_compelet_Register_Button_clicked();

private:
    QPropertyAnimation *Register_QPropertyAnimation_1;
    QPropertyAnimation *Register_QPropertyAnimation_2;
    QPropertyAnimation *Register_QPropertyAnimation_3;
    QPropertyAnimation *Register_QPropertyAnimation_4;
    QPropertyAnimation *Register_QPropertyAnimation_5;
    QPropertyAnimation *Register_QPropertyAnimation_6;
    QPropertyAnimation *Register_QPropertyAnimation_7;
    QPropertyAnimation *Register_QPropertyAnimation_8;
    QPropertyAnimation *Register_QPropertyAnimation_9;
    QPropertyAnimation *Register_QPropertyAnimation_10;
    QPropertyAnimation *Register_QPropertyAnimation_11;
    QPropertyAnimation *Register_QPropertyAnimation_12;
    QPropertyAnimation *Register_QPropertyAnimation_13;
    QPropertyAnimation *Register_QPropertyAnimation_14;
    QPropertyAnimation *Register_QPropertyAnimation_15;
    QPropertyAnimation *Register_QPropertyAnimation_16;
    QPropertyAnimation *Register_QPropertyAnimation_17;
    QPropertyAnimation *Register_QPropertyAnimation_18;
    QPropertyAnimation *Register_QPropertyAnimation_19;
    QPropertyAnimation *Register_QPropertyAnimation_20;
    QPropertyAnimation *Register_QPropertyAnimation_21;
    QPropertyAnimation *Register_QPropertyAnimation_22;
    QPropertyAnimation *Register_QPropertyAnimation_23;
    QPropertyAnimation *Register_QPropertyAnimation_24;
    QPropertyAnimation *Register_QPropertyAnimation_25;
    QPropertyAnimation *Register_QPropertyAnimation_26;
    QPropertyAnimation *Register_QPropertyAnimation_27;
    QPropertyAnimation *Register_QPropertyAnimation_28;
    QPropertyAnimation *Register_QPropertyAnimation_29;
    QPropertyAnimation *Register_QPropertyAnimation_30;
    QPropertyAnimation *Register_QPropertyAnimation_31;
    QPropertyAnimation *Register_QPropertyAnimation_32;
    QPropertyAnimation *Register_QPropertyAnimation_33;
    QPropertyAnimation *Register_QPropertyAnimation_34;
    QPropertyAnimation *Register_QPropertyAnimation_35;
    QPropertyAnimation *Register_QPropertyAnimation_36;
    QPropertyAnimation *Register_QPropertyAnimation_37;
    QPropertyAnimation *Register_QPropertyAnimation_38;
    QPropertyAnimation *Register_QPropertyAnimation_39;
    QPropertyAnimation *Register_QPropertyAnimation_40;





private:
    Ui::MainWindow *ui;
    user_Interact_Window *user_interact_window = new user_Interact_Window;

private:
    void mousePressEvent(QMouseEvent* event) override;
    void mouseMoveEvent(QMouseEvent* event) override;

private:
    QPoint diff_pos;  // 鼠标和窗口的相对位移
    QPoint window_pos;
    QPoint mouse_pos;

private:
    bool registerOrLogin_stat = 1;

    sqlite3 *db;

    sqlite3_stmt *res;

    SSL_CTX *ctx;

    int rc = 0;

    int client_socket;

    SSL *ssl;


};
#endif // MAINWINDOW_H
